package cn.vshare.alipay;


import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="2016092100564748";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCOfqjcFGaWaWAUlnpomHWC2JInY7GSkcUrIuFmgn6K2cTKpvSFROPtx6qgxEvlCn8/jjPEchs6U9bpwb/X8TTPueW4h4DbajyLZfu4JX/8HoVvLwiUwoycnZXd+uOjL/f5IBVDCICo/389UlexZM3JcZI0wUSEEf+HVKQz42HikB5bkv9TAl736nu7IujpI9uSZiyYDQt8CF4bn5Taid5UidfQtflzTLNgtnGJTrKo/lplnFF0U4OZruSXor/Ih3Bc2sCwaRlLcm7qfD2018HIxgyrQUDJMCoRZoYMvwWZKDCYNg3tdIWu63wzAbCTZZkeIJPyMXvS5V+wqxEOzhNzAgMBAAECggEAYNthZi8LyGOaJoRecihnf+g7+EBAnHMvRXHxKl+7KiB6LpGrlcbM83yL07l6KRaohgff0kEJlu0UIVJMV7kh/6zJpFOe2AXvX4WTw4jh5PrOElQzDgLr1y0aiIeYIf1iHdmb+jOWWMlKsOD+sJrncm0bR3azXt5pBZEYCBkgGQJ/qTBm+yb3DDX5kHcuUNDEuXAcLdjRRHsfjAfM4skKgvz9NC8LhaDr8EvQuiacOzd48NENOBKskn7Gy3CaxgQNs87oLH4oaYU2s1SKCZAWCTiK8XGCFZtJh0x0YGdqaww8FN3V2efBNHdJUnFLlryxSPcSZ1p711uy72z4IRL8+QKBgQC/yIs259UsMk01r2xoxmc1jZmAfyfbTmYIM+UBS1p/8Akq19no2ZWin9D1q00tzotkqt5xa/8Vy+H2aMbEbwiMZRyIyhTvo4SGwcgQelS+459eYguRRQmzejx1hJis3Clpr8ZqdQJg5eGJxmS6X8e83OWtXUpjCFUW0sOxu0cLbQKBgQC+NSa73VX53eCAEWu+EX2OxaHd81E+VKzbkVYJpUyFLVqjC+cj+AW00N+vbVnE+fdEIuVJO0xZ3hQ6gRZMa8hklhjAqgDaUAYKum8awJCzzQ07uYzU9hgui8Y9Zb7JIV0wfgHHnnUCvA9VN9B1RIEzhWDsvV28tlCTGMMwDahuXwKBgQCQQDlmLO5MdfFZJf92t3S99Sm2Wu4RqGBaXx4q4RDLFjLvBLgkyjQgw/CaOCSvBaIXL+ZsjXyqWlY1zw1ihtl5MDxMLyOcM/PkoDDpI/pGMlOW3EwzEih/1LtQ8VEdA+QqWEn3nNcTJxWDWbQ98vj7d3NR+M+QuZ22swT61BBV6QKBgQClY94sWMdbn1yIv50qBldg/+RB9ELeqg4sVfG0LXGeE9POFpmDozSDB2SZS8JVDu2854Lr7I31Tq/UN07GYKo9HG6liK15J0A5r+bQIkUwssog9rTIsLxSLOPRm1kL1uELO2Ycx2IDYLcMaJ3wegLGY+HluLt7TiQ947hFXnrojQKBgGYMVncW4kWk1zR2C55N49pKOGPBAOCkf0mfWuWKP5yzoUWZhVHswwjxYr3/uPyr1moM4mylLsfJA6CAxojO1iAogLYTUeeHvUPzCNzdY12RAiV81tpOTENSZvV2Hh92rTdgXvlG0h53tXn/ilAkub5fswfdJ72COOlVPLda8Gh2";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key =  "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzL86u3xzI4bwePkk6Pyq050Ls6V7fNKYaTZ6NIsdETwVxFOWOW6uuKCa46UvAdW4DZ6sxJvUeNW5V1Y3tLBn2Yvr8UJoEZXrczUNlxib8IOQyYBEqAkzyXs9KXPimxG3tkBhAvkHVZ4QKDLB64E38MuDPeXm4FNg3r11+sL2Mg67QCab7SB58LZnb85veXiugaNV63p2qbTITfFfEqhRBgg1BSgLkcyCPG38qX9OnRZquoUW8p0qqEUVK3vKKRGZzTHyaQc+6o+sMjBN+AO5FnUE4jLrrJ3egAjg8aU9/jzTR92cuncV8PSUav/c2Puevq5NpNeIMWFxhfsqIn5MQQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://5nisr9.natappfree.cc/notify_url.do";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://5nisr9.natappfree.cc/return_url.do";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

